package com.yanyu.space.common.sleuth.rocket;

import org.springframework.cloud.stream.binder.ProducerProperties;
import org.springframework.cloud.stream.binding.BinderAwareChannelResolver;
import org.springframework.cloud.stream.messaging.DirectWithAttributesChannel;
import org.springframework.messaging.MessageChannel;

/**
 * @author gz
 */

public class SpaceNewDestinationBindingCallback implements BinderAwareChannelResolver.NewDestinationBindingCallback {
    @Override
    public void configure(String channelName, MessageChannel channel, ProducerProperties producerProperties, Object extendedProducerProperties) {
        DirectWithAttributesChannel newChannel = (DirectWithAttributesChannel)channel;
//        newChannel.setAttribute();
        newChannel.setAttribute("channelName", channelName);
        System.out.println("-----------");
    }
}
